<?php

declare(strict_types=1);

namespace App\CustHub\Model;

use Mine\MineModel;

/**
 * @property int $id 
 * @property int $uid 
 * @property int $main_uid 
 * @property string $name 名称
 * @property string $member_id 联盟用户ID
 * @property int $type 联盟类型
 * @property string $code 接口标识（api接口配置用到）
 * @property string $access_token 接口调用凭据
 * @property string $refresh_token 
 * @property int $auth_time 授权时间
 * @property int $expire_time 到期时间
 * @property int $status 状态，默认0=未授权，1=正常
 * @property \Carbon\Carbon $created_at 
 * @property \Carbon\Carbon $updated_at 
 */
class ChAffiliateAccount extends MineModel
{

    public const ACCOUNT_TAG_KEY = 'affiliate_account_tag';

    /**
     * The table associated with the model.
     */
    protected ?string $table = 'ch_affiliate_account';

    /**
     * The attributes that are mass assignable.
     */
    protected array $fillable = ['id', 'uid', 'main_uid', 'name', 'member_id', 'type', 'code', 'access_token', 'refresh_token', 'auth_time', 'expire_time', 'status', 'created_at', 'updated_at'];

    /**
     * The attributes that should be cast to native types.
     */
    protected array $casts = ['id' => 'integer', 'uid' => 'integer', 'main_uid' => 'integer', 'type' => 'integer', 'auth_time' => 'integer', 'expire_time' => 'integer', 'status' => 'integer', 'created_at' => 'datetime', 'updated_at' => 'datetime'];
}
